#ifndef SECGEAR_KMS_ERROR_CODE_H
#define SECGEAR_KMS_ERROR_CODE_H

#ifdef __cplusplus
extern "C" {
#endif

#define SDR_OK            0x0
#define SDR_BASE        0x01000000
#define SDR_UNKNOWERR        (SDR_BASE + 0x00000001)
#define SDR_NOTSUPPORT        (SDR_BASE + 0x00000002)
#define SDR_COMMFAIL        (SDR_BASE + 0x00000003)
#define SDR_HARDFAIL        (SDR_BASE + 0x00000004)
#define SDR_OPENDEVICE        (SDR_BASE + 0x00000005)
#define SDR_OPENSESSION        (SDR_BASE + 0x00000006)
#define SDR_PARDENY        (SDR_BASE + 0x00000007)
#define SDR_KEYNOTEXIST        (SDR_BASE + 0x00000008)
#define SDR_ALGNOTSUPPORT    (SDR_BASE + 0x00000009)
#define SDR_ALGMODNOTSUPPORT    (SDR_BASE + 0x0000000A)
#define SDR_PKOPERR        (SDR_BASE + 0x0000000B)
#define SDR_SKOPERR        (SDR_BASE + 0x0000000C)
#define SDR_SIGNERR        (SDR_BASE + 0x0000000D)
#define SDR_VERIFYERR        (SDR_BASE + 0x0000000E)
#define SDR_SYMOPERR        (SDR_BASE + 0x0000000F)
#define SDR_STEPERR        (SDR_BASE + 0x00000010)
#define SDR_FILESIZEERR        (SDR_BASE + 0x00000011)
#define SDR_FILENOEXIST        (SDR_BASE + 0x00000012)
#define SDR_FILEOFSERR        (SDR_BASE + 0x00000013)
#define SDR_KEYTYPEERR        (SDR_BASE + 0x00000014)
#define SDR_KEYERR        (SDR_BASE + 0x00000015)
#define SDR_ENCDATAERR        (SDR_BASE + 0x00000016)
#define SDR_RANDERR        (SDR_BASE + 0x00000017)
#define SDR_PRKRERR        (SDR_BASE + 0x00000018)
#define SDR_MACERR        (SDR_BASE + 0x00000019)
#define SDR_FILEEXSITS        (SDR_BASE + 0x0000001A)
#define SDR_FILEWERR        (SDR_BASE + 0x0000001B)
#define SDR_NOBUFFER        (SDR_BASE + 0x0000001C)
#define SDR_INARGERR        (SDR_BASE + 0x0000001D)
#define SDR_OUTARGERR        (SDR_BASE + 0x0000001E)

enum SecGear_Error {
    Err_OK = 0,
    Err_BAD_ENCLAVE_PATH = 1,
    Err_CREATE_ENCLAVE = 2,
    Err_DESTORY_ENCLAVE = 3,
    Err_CREATE_SESSION = 4,
    Err_CLOSE_SESSION = 5,
    Err_INVALID_SESSION = 6,
    Err_INVALID_DEVICE = 7,
    Err_GET_PRIVATE_KEY_ACCESS_RIGHT = 8,
    Err_RELEASE_PRIVATE_KEY_ACCESS_RIGHT = 9,
    Err_GENERATE_RANDOM = 10,
    Err_SYM_ENCRYPT,
    Err_SYM_DECRYPT,
    Err_HASH_INIT,
    Err_HASH_UPDATE,
    Err_HASH_FINAL,
    Err_INVALID_PARAM,
    Err_NOT_SUPPORT,
    Err_STORAGE,
    Err_SEALED_DATA_FILE_NOT_EXIST,
    Err_CREATE_DEVICE,
    Err_CLOSE_DEVICE,
    Err_NO_MEMORY,
    Err_INTERNAL,
    Err_PASSWORD_NOT_MATCH,
    Err_PASSWORD_ALREADY_EXIST,
    Err_KEY_NOT_EXIST,
    Err_CREATE_PRIVATE_KEY_ACCESS_PASSWORD,
    Err_SIGNATURE_NOT_MATCH,
    Err_ECC_DECRYPT,
    Err_ECC_ENCRYPT,
    Err_ECC_EXPORT_PUBLIC_KEY,
    Err_SIGNERR,
    Err_VERIFYERR,
    Err_PATH_ALREAD_USED
};

#ifdef __cplusplus
}
#endif

#endif // SECGEAR_KMS_ERROR_CODE_H